/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/
package com.nurdrobotics;

import edu.wpi.first.wpilibj.*;

/**
 *
 */
public class Stager {

    private static SpeedController m_jaguarVertical = null;
    private static boolean m_running = false;

    public static boolean init() {
        m_jaguarVertical = Motor.getInstance(Motor.ID_STAGER_VERTICAL);
        if ((m_jaguarVertical == null)) {
            Dashboard.setStagerStatus("ERR");
            return false;
        }
        return true;

    }

    /*
     * run the stager
     */
    public static void start(double speed) {
        m_running = true;
        m_jaguarVertical.set(speed);
    }

    /*
     * run the stager (in reverse! which is actually the same as ejecting
     */
    public static void reverse() {
        m_running = true;
        m_jaguarVertical.set(-1);
    }

    /*
     * stop the stager
     */
    public static void stop() {
        m_running = false;
        m_jaguarVertical.set(0);
    }

    /*
     * This routine returns true if the lifter is running, false otherwise
     */

    public static boolean isRunning() {
        return (m_running);
    }
}
